<!-- Modal -->
<div class="modal-dialog wide" style="width: 550px;">
    <div class="modal-content">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
            <h4 class="modal-title" id="myModalLabel">
            <#if ykBill??>
                <#if ykBill.id??>
                    编辑
                <#else>
                    新增
                </#if>
            </#if>
            </h4>
        </div>
        <div class="modal-body">
            <div id="errorMessage"><#include "../../message.ftl" /></div>
            <form class="form-horizontal" role="form" id="ykBillForm" method="post"
                  action="${absoluteContextPath}/members/ykBill/save">
            <#if ykBill??>
                <#if ykBill.id??>
                    <input type="hidden" name="id" value="${ykBill.id}"/>
                <#else>
                    <input type="hidden" name="id" value=""/>
                </#if>
            </#if>
                <div class="row">
                    <div class="form-group col-md-12">
                        <label class="col-sm-4 control-label"></label>

                        <div class="col-sm-6">
                            <input name="id" value="${ykBill.id!''}" type="text" class="form-control"/>
                        </div>
                    </div>
                    <div class="form-group col-md-12">
                        <label class="col-sm-4 control-label">卡号</label>

                        <div class="col-sm-6">
                            <input name="cardId" value="${ykBill.cardId!''}" type="text" class="form-control"/>
                        </div>
                    </div>
                    <div class="form-group col-md-12">
                        <label class="col-sm-4 control-label">产品id</label>

                        <div class="col-sm-6">
                            <input name="vipId" value="${ykBill.vipId!''}" type="text" class="form-control"/>
                        </div>
                    </div>
                    <div class="form-group col-md-12">
                        <label class="col-sm-4 control-label">开卡日期</label>

                        <div class="col-sm-6">
                            <input name="startDate" value="${(ykBill.startDate?string("yyyy-MM-dd"))!''}" type="text"
                                   class="form-control"/>
                        </div>
                    </div>
                    <div class="form-group col-md-12">
                        <label class="col-sm-4 control-label">到期日期</label>

                        <div class="col-sm-6">
                            <input name="endDate" value="${(ykBill.endDate?string("yyyy-MM-dd"))!''}" type="text"
                                   class="form-control"/>
                        </div>
                    </div>
                    <div class="form-group col-md-12">
                        <label class="col-sm-4 control-label">引荐人</label>

                        <div class="col-sm-6">
                            <input name="healthYj" value="${ykBill.healthYj!''}" type="text" class="form-control"/>
                        </div>
                    </div>
                    <div class="form-group col-md-12">
                        <label class="col-sm-4 control-label">促会人</label>

                        <div class="col-sm-6">
                            <input name="healthCh" value="${ykBill.healthCh!''}" type="text" class="form-control"/>
                        </div>
                    </div>
                    <div class="form-group col-md-12">
                        <label class="col-sm-4 control-label">分管人</label>

                        <div class="col-sm-6">
                            <input name="healthFg" value="${ykBill.healthFg!''}" type="text" class="form-control"/>
                        </div>
                    </div>
                    <div class="form-group col-md-12">
                        <label class="col-sm-4 control-label">副会</label>

                        <div class="col-sm-6">
                            <input name="vipFh" value="${ykBill.vipFh!''}" type="text" class="form-control"/>
                        </div>
                    </div>
                    <div class="form-group col-md-12">
                        <label class="col-sm-4 control-label">上次产品id</label>

                        <div class="col-sm-6">
                            <input name="upVipId" value="${ykBill.upVipId!''}" type="text" class="form-control"/>
                        </div>
                    </div>
                    <div class="form-group col-md-12">
                        <label class="col-sm-4 control-label">上次引荐人</label>

                        <div class="col-sm-6">
                            <input name="upHealthYj" value="${ykBill.upHealthYj!''}" type="text" class="form-control"/>
                        </div>
                    </div>
                    <div class="form-group col-md-12">
                        <label class="col-sm-4 control-label">上次促会人</label>

                        <div class="col-sm-6">
                            <input name="upHealthCh" value="${ykBill.upHealthCh!''}" type="text" class="form-control"/>
                        </div>
                    </div>
                    <div class="form-group col-md-12">
                        <label class="col-sm-4 control-label">上次分管人</label>

                        <div class="col-sm-6">
                            <input name="upHealthFg" value="${ykBill.upHealthFg!''}" type="text" class="form-control"/>
                        </div>
                    </div>
                    <div class="form-group col-md-12">
                        <label class="col-sm-4 control-label">上次副会</label>

                        <div class="col-sm-6">
                            <input name="upVipFh" value="${ykBill.upVipFh!''}" type="text" class="form-control"/>
                        </div>
                    </div>
                    <div class="form-group col-md-12">
                        <label class="col-sm-4 control-label">创建人</label>

                        <div class="col-sm-6">
                            <input name="createUser" value="${ykBill.createUser!''}" type="text" class="form-control"/>
                        </div>
                    </div>
                    <div class="form-group col-md-12">
                        <label class="col-sm-4 control-label">创建时间</label>

                        <div class="col-sm-6">
                            <input name="createTime" value="${(ykBill.createTime!?string("yyyy-MM-dd"))''}" type="text"
                                   class="form-control"/>
                        </div>
                    </div>
                </div>
            </form>
        </div>
        <div class="modal-footer">
            <button type="button" class="btn btn-default" data-dismiss="modal" aria-hidden="true">关闭</button>
            <button type="button" class="btn btn-primary" onclick="save();">保存</button>
        </div>
    </div>
</div>
<script>
    function save() {
        $("#" + "ykBillForm").ajaxSubmit({
            success: function (data) {
                data = JSON.parse(data);
                if (data.returnCode == 1) {
                    $('#myModal').modal("hide");
                    $.showMessage({parentId: "showMessage", message: "信息保存成功！", type: "success"});
                    refreshTable();
                } else {
                    $.showMessage({parentId: "errorMessage", message: "<strong>错误信息</strong>：" + data.returnMsg, type: "error"});
                }
            }
        });
    }
</script>